# some NT Win32 nmake macros
# for now this resides in samples\inc

!include <ntwin32.mak>

cvars=-DNT -DWIN -DWIN32 -DNOT_IMPLEMENTED

# This line allows NMAKE to work as well

all: gdidemo.exe

# Update the object file if necessary

gdidemo.obj: gdidemo.c draw.h gdidemo.h maze.h poly.h xform.h
    $(cc) $(cflags) $(cvars) gdidemo.c
    cvtomf gdidemo.obj

init.obj: init.c draw.h gdidemo.h maze.h poly.h xform.h
    $(cc) $(cflags) $(cvars) init.c
    cvtomf init.obj

dialog.obj: dialog.c gdidemo.h
    $(cc) $(cflags) $(cvars) dialog.c
    cvtomf dialog.obj

wininfo.obj: wininfo.c gdidemo.h
    $(cc) $(cflags) $(cvars) wininfo.c
    cvtomf wininfo.obj

poly.obj: poly.c gdidemo.h poly.h
    $(cc) $(cflags) $(cvars) poly.c
    cvtomf poly.obj

xform.obj: xform.c gdidemo.h xform.h
    $(cc) $(cflags) $(cvars) xform.c
    cvtomf xform.obj

maze.obj: maze.c gdidemo.h maze.h
    $(cc) $(cflags) $(cvars) maze.c
    cvtomf maze.obj

draw.obj: draw.c draw.h gdidemo.h
    $(cc) $(cflags) $(cvars) draw.c
    cvtomf draw.obj

bounce.obj: bounce.c bounce.h gdidemo.h
    $(cc) $(cflags) $(cvars) bounce.c
    cvtomf bounce.obj

# Update the resources if necessary

gdidemo.res: gdidemo.rc gdidemo.h
    rc -r -fo gdidemo.tmp gdidemo.rc
    cvtres -i386 gdidemo.tmp -o gdidemo.res
    del gdidemo.tmp

# Update the executable file if necessary, and if so, add the resource back in.

gdidemo.exe: gdidemo.obj init.obj bounce.obj dialog.obj wininfo.obj \
	     poly.obj xform.obj maze.obj draw.obj gdidemo.res gdidemo.def
    $(link) $(guiflags) -out:gdidemo.exe   \
    gdidemo.obj bounce.obj init.obj dialog.obj wininfo.obj poly.obj \
    xform.obj maze.obj draw.obj gdidemo.res $(guilibs)
